// 输出数组元素地址
#include <iostream>
#include <string>
#include <stdio.h>

/*
0x7fff8c13e450
0x7fff8c13e451
0x7fff8c13e452
0x7fff8c13e453
0x7fff8c13e454
0x7fff8c13e455
0x7fff8c13e456
0x7fff8c13e457
0x7fff8c13e458
0x7fff8c13e459
0x7fff8c13e45a
*/

using namespace std;

int main(int argc, char **argv)
{
    // 字符串隐式转换
    string str = "hello world";

    // 获取字符串大小
    int sz = str.size();
    cout << sz << endl;

    // 输出地址
    for (int i = 0; i < sz; i++)
    {
        printf("%p\n", &str[i]);
    }
    
    return 0;
}